<template>
  <div id="app">
    <el-container>
      <el-header>Maven + Servlet + MyBatis + Vue + ElementUI整合开发</el-header>
      <el-container>
        <el-aside width="160px">
          <el-menu
                  router
                  class="el-menu-vertical-demo"
                  background-color="#545c64"
                  text-color="#fff"
                  active-text-color="#ffd04b">
            <el-submenu :index="m.path" v-for="m in menus">
              <template slot="title">
                <i :class="m.icon"></i>
                <span>{{m.title}}</span>
              </template>
              <el-menu-item :index="m.path + child.path" v-for="child in m.children">
                <i :class="child.icon"></i>
                <span slot="title">{{child.title}}</span>
              </el-menu-item>
            </el-submenu>
          </el-menu>
        </el-aside>
        <el-main>
          <router-view/>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<style>
  *{
    padding:0;
    margin:0
  }
  .el-header, .el-footer {
    background-color: rgb(84,92,100);
    color: white;
    text-align: right;
    line-height: 60px;
  }
  .el-menu-item{
    margin-left: 10px;
  }
  .el-aside {
    background-color: rgb(84,92,100);
    color: #333;
    text-align: left;
    line-height: 50px;
    height: 800px;

  }
  .el-menu{
    border-right:0!important;   /*去掉右侧的竖线*/
  }
  .el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
  }

  body > .el-container {
    margin-bottom: 40px;
  }

  .el-container{
    padding:0;
  }

</style>

<script>
  import menus from "@/api/menu";
  export default {
    name:'App',
    data(){
      return {
        menus
      }
    },
    created() {
      console.log(this.menus)
    }
  }
</script>